8195ef9e7a574a8b2e62d1fda3c0fe6a3249d21d,modules/lang-painless/src/main/java/org/elasticsearch/painless/Definition.java,Definition,addField,#String#String#String#boolean#Type#Type#,1635

Before Change



        if (generic != null) {
            try {
                generic.clazz.asSubclass(type.clazz);
            } catch (final ClassCastException exception) {
                throw new ClassCastException("Generic type [" + generic.clazz.getCanonicalName() + "]" +
                    " is not a sub class of [" + type.clazz.getCanonicalName() + "] for the field" +

After Change


        }

        if (generic != null) {
            if (!type.clazz.isAssignableFrom(generic.clazz)) {
                throw new ClassCastException("Generic type [" + generic.clazz.getCanonicalName() + "]" +
                    " is not a sub class of [" + type.clazz.getCanonicalName() + "] for the field" +
                    " [" + name + " ] from the struct [" + owner.name + "].");